package com.mz.mattress.client.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mz.mattress.api.common.Result;
import com.mz.mattress.api.entity.Device;
import com.mz.mattress.api.entity.OrderUseTimes;
import com.mz.mattress.api.enums.DeviceOptionEnum;
import com.mz.mattress.api.mattress.req.InspectionReq;
import com.mz.mattress.client.api.req.OrderUseRecordQueryReq;

import java.util.List;

public interface OrderUseTimesService {

    //按摩时长
    Integer DURATION = 60;

//    Result<List<OrderUseTimes>> listByStatus(Integer status, Long memberId);

    Result<List<OrderUseTimes>> doingList(Long memberId);

    Result<List<OrderUseTimes>> list(Long orderId);

    Result<IPage<OrderUseTimes>> listPage(OrderUseRecordQueryReq req);

    /**
     * 详情
     * @param id
     * @return
     */
    Result<OrderUseTimes> detail(Integer id);

    //查看设备状态
    Result queryStatus(Integer id);

    //提交检测
    Result inspection(InspectionReq req);

    //开始按摩
    Result start(Integer id, Integer minute, Integer mode);

    //暂停
    Result pause(Integer id);

    //结束
    Result stop(Integer id);

    //调节选项
    Result changeOption(Integer id, DeviceOptionEnum optionEnum, Integer value);

    //设备信息
    Result<Device> deviceInfo(Integer id);

    void insert(OrderUseTimes record);

    void sendBonus(Integer id);

    void sendBonus2(OrderUseTimes times);

    void sendBonusToMember(Long memberId, Integer totalMoney, Integer bonus,
                           Integer type, Integer typeId, Integer merchantId, String merchantName,
                           String name, String mobile,
                           Integer recordId, Long orderId, Integer grade, Integer bonusRatio);

    void backBonus(Integer id);

    /**
     * 检测报告
     * @param memberId
     * @return
     */
    Result<List<OrderUseTimes>> reportList(Long memberId);

    Result<OrderUseTimes> reportDetail(Integer id);

}
